<!DOCTYPE HTML>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/style.css">
<link rel="stylesheet" type="text/css" href="../css/doc.css">
<link rel="stylesheet" type="text/css" href="../css/xian.css">
<title>新东方词汇测评结果</title>
<script type="text/javascript">
    function pd1() {

        
        window.opener=null;
        window.open('','_self');
        window.close();
        window.open('../../index.html', '_blank');

    }
</script>
</head>
<body>
<div id="header">
	<img src="../img/logo.png"><h1>词汇测评结果</h1>
</div>

<?php

$wordnum = "{$_POST['wordnum']}";
//echo $wordnum.'<br />';

$ques1 = "{$_POST['ques1']}";
$ques2 = "{$_POST['ques2']}";
$ques3 = "{$_POST['ques3']}";
$ques4 = "{$_POST['ques4']}";
$ques5 = "{$_POST['ques5']}";
$ques6 = "{$_POST['ques6']}";
$ques7 = "{$_POST['ques7']}";
$ques8 = "{$_POST['ques8']}";
$ques9 = "{$_POST['ques9']}";
$ques10 = "{$_POST['ques10']}";
$ques11 = "{$_POST['ques11']}";
$ques12 = "{$_POST['ques12']}";

if($ques1 == "" || $ques2 == "" || $ques3 == "" || $ques4 == "" || $ques5 == "" || $ques6 == "" || $ques7 == "" || $ques8 == "" || $ques9 == "" || $ques10 == "" || $ques11 == "" || $ques12 == "")
{
	echo '<script type="text/javascript">window.history.go(-1);alert("试卷没答完，你别急啊！");
		</script>';
	break;
}

/*
echo $wordnum;
echo $ques1;
echo $ques2;
echo $ques3;
echo $ques4;
echo $ques5;

echo '<br />';
echo '<br />';
echo '<br />';
*/

$ques = array($ques1,$ques2,$ques3,$ques4,$ques5,$ques6,$ques7,$ques8,$ques9,$ques10,$ques11,$ques12);
$word1 = array('B','C','B','C','A','B','A','C','A','B','C','A');
$word2 = array('A','A','B','A','B','B','C','A','B','A','C','A');
$word3 = array('A','C','A','B','C','B','A','C','C','A','B','C');
$word4 = array('A','B','A','C','A','C','A','B','A','C','A','A');
$word5 = array('A','B','B','A','A','C','B','B','A','A','B','A');

if($wordnum == 5){
	$word = $word5;
}elseif($wordnum == 4){
	$word = $word4;
}elseif($wordnum == 3){
	$word = $word3;
}elseif($wordnum == 2){
	$word = $word2;
}elseif($wordnum == 1){
	$word = $word1;
}

$finals = checklis($ques,$word);
//echo '你的等级是：<font color="#f00" size="200">'.$finals.'</font>';


  function checklis($ques,$word)
	{
		$s = 0;
    	for ($i=0; $i < 12; $i++) { 
    		//echo $ques[$i];
    		//echo $lis[$i].'<br />';
    		//$j = $i+1;
    		if($ques[$i] == $word[$i]){
    			//echo '<font color="#06f">第'.$j.'题正确</font>';
                //echo '你选的是'.$ques[$i].'正确的是'.$word[$i].'<br />';
    			$s = $s + 1;
    		}else{
    			//echo '<font color="#f00">第'.$j.'题错误</font>';
    			//echo '你选的是'.$ques[$i].'正确的是'.$word[$i].'<br />';
    			$s = $s;
    		}
    	}

        $s = $s/12;

    	if($s>0.79){
    		$s = '<img src="../img/a.png"><font color="#FF5050" size="150px">你真棒哈！</font>';
    	}elseif($s>0.59){
    		$s = '<img src="../img/b.png"><font color="#FF9000" size="150px">还不错呢！';
    	}elseif($s>0.39){
    		$s = '<img src="../img/c.png"><font color="#50BB3E" size="150px">要努力哦！';
    	}else{
    		$s = '<img src="../img/d.png"><font color="#5F6682" size="150px">报个班吧！';
    	}

    	return $s;
    }


?>
<div class="testcontent2" id="tc1">
    <div class="testtitle">
    <?php echo $finals; ?>
    </div>
</div>
<div class="testcontent2" id="tc2">
	<div class="testanswer">
		<label>A等级 正确率80%以上<br />
		B等级 正确率60%以上<br />
		C等级 正确率40%以上<br />
		D等级 正确率低于40%</label>
	</div>
</div>
<div class="testcontent2">
    <div class="testtitle">
    答题结束，请告知老师你的分数。
    <!--
    <a href="../../index.html" target="_self"><button class="btn btn-large btn-info">开始听力答题</button></a>
    -->
    <button class="btn btn-large btn-info" onclick="pd1()">关闭页面</button>    
    </div>
</div>
<div id="footer">新东方西安学校</div>
</body>
</html>